index.html.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663
  1. <template>
  2. <!-- 页面头部 -->
  3. <HomePageHead></HomePageHead>
  4. <!-- 导航栏 -->
  5. <HomePageNavigation></HomePageNavigation>
  6. <!-- 面包屑导航 -->
  7. <div class="breadcrumb">
  8. <div class="inner">
  9. <span class="location">您的位置:</span>
  10. <el-breadcrumb :separator-icon="ArrowRight">
  11. <el-breadcrumb-item>
  12. <NuxtLink to="/">首页</NuxtLink>
  13. </el-breadcrumb-item>
  14. <el-breadcrumb-item>
  15. {{ newsDetail.con_title }}
  16. </el-breadcrumb-item>
  17. </el-breadcrumb>
  18. </div>
  19. </div>
  20. <!-- 资讯列表 -->
  21. <div class="newsDetail">
  22. <div class="inner">
  23. <div class="innerLeft">
  24. <div class="leftBottomImg" v-if="newsDetail.con_title == '会员服务'">
  25. <img src="../../../public/index/hyfw.jpg" alt="">
  26. </div>
  27. <div class="leftBottomImg" v-if="newsDetail.con_title == '联系我们'">
  28. <img src="../../../public/index/lxwm.jpg" alt="">
  29. </div>
  30. <div class="leftBottomImg" v-if="newsDetail.con_title == '法制项目简介'">
  31. <img src="../../../public/index/xmwzjj.png" alt="">
  32. </div>
  33. <div class="leftBottomImg" v-if="newsDetail.con_title == '免责声明'">
  34. <img src="../../../public/index/mzsm.png" alt="">
  35. </div>
  36. <div class="leftBottom" v-html="newsDetail.content" v-if="newsDetail.content"></div>
  37. </div>
  38. <div class="innerRight">
  39. <ul>
  40. <li v-for="(item, index) in bottomMenu" :key="index">
  41. <NuxtLink v-if="item.type == 0" :to="`/about/${item.name_pinyin}/index.html`" :title="item.name"
  42. :class="item.id == pageId ? 'active' : ''">
  43. {{ item.name }}
  44. </NuxtLink>
  45. <NuxtLink v-else-if="item.type == 1" :to="`/about/${item.name_pinyin}/list-1.html`"
  46. :title="item.name" :class="item.id == pageId ? 'active' : ''">
  47. {{ item.name }}
  48. </NuxtLink>
  49. </li>
  50. </ul>
  51. </div>
  52. <div style="clear: both;"></div>
  53. </div>
  54. </div>
  55. <!-- 页面底部 -->
  56. <HomeFoot></HomeFoot>
  57. </template>
  58. <script setup>
  59. //1.页面依赖 start ---------------------------------------->
  60. import { ElBreadcrumb, ElBreadcrumbItem } from 'element-plus'
  61. import { ArrowRight } from '@element-plus/icons-vue'
  62. import { ref, onMounted } from 'vue';
  63. //获得跳转过来的id
  64. const route = useRoute();
  65. //获得当前的完整路径
  66. const fullPath = route.path;
  67. //拆分,取出来中间这一段,然后提取数字部分
  68. const segments = fullPath.split('/');
  69. const targetSegment = segments[2];
  70. //const numberPart = targetSegment.match(/\d+$/)?.[0];
  71. let articleId;
  72. let pageId;
  73. //通过导航路径反向查询导航id
  74. const getRouteId = await requestDataPromise('/web/getWebsiteRoute', {
  75. method: 'GET',
  76. query: {
  77. 'foot_pinyin': targetSegment,
  78. },
  79. });
  80. if (getRouteId.code == 200) {
  81. articleId = getRouteId.data.id;
  82. pageId = getRouteId.data.id;
  83. } else {
  84. // console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  85. // console.log("错误位置:通过url路径查询导航池id")
  86. // console.log("后端错误反馈:",getRouteId.message)
  87. // console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  88. }
  89. //1.页面依赖 end ---------------------------------------->
  90. //2.页面数据 start ---------------------------------------->
  91. //广告列表
  92. const adList = ref([]);
  93. let adImg1 = ref([]);
  94. let adImg2 = ref([]);
  95. async function getAdData() {
  96. const adData = await requestDataPromise('/web/getWebsiteAdvertisement', { method: 'GET', query: { 'ad_tag': 'PAGE' } });
  97. adList.value = adData.data;
  98. if (adData.code == 200) {
  99. for (let item of adData.data) {
  100. if (item.ad_tag == 'PAGE_0001') {
  101. adImg1.value = item;
  102. }
  103. if (item.ad_tag == 'PAGE_0002') {
  104. adImg2.value = item;
  105. }
  106. }
  107. } else {
  108. console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  109. console.log("错误位置:获取详情页广告列表")
  110. console.log("后端错误反馈:", adData.message)
  111. console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  112. }
  113. }
  114. getAdData();
  115. const newsDetail = ref({})
  116. const bottomMenu = ref([]);
  117. async function getPageData() {
  118. const mkdata = await requestDataPromise('/web/getWebsiteFooterCategoryInfo', {
  119. method: 'GET',
  120. query: {
  121. 'fcat_id': articleId
  122. },
  123. });
  124. newsDetail.value = mkdata.data;
  125. }
  126. getPageData();
  127. async function getPageMenu() {
  128. const mkdata = await requestDataPromise('/web/getWebsiteFooterCategory', {
  129. method: 'GET',
  130. query: {},
  131. });
  132. bottomMenu.value = mkdata.data;
  133. }
  134. getPageMenu();
  135. //2.页面数据 end ---------------------------------------->
  136. //4.设置seo信息 start---------------------------------------->
  137. //4.1 设置seo信息
  138. const setData = await requestDataPromise('/web/getWebsiteFootInfo', {
  139. method: 'GET',
  140. query: {},
  141. });
  142. let seoTitle = setData.data.website_head.title;
  143. let seoDescription = setData.data.website_head.description;
  144. let seoKeywords = setData.data.website_head.keywords;
  145. let seoSuffix = setData.data.website_head.suffix;
  146. let seoName = setData.data.website_head.website_name;
  147. useSeoMeta({
  148. title: seoTitle + "_" + seoSuffix,
  149. meta: [
  150. { name: 'description', content: seoDescription + "_" + seoName + "_" + seoSuffix, tagPriority: 10 },
  151. { name: 'keywords', content: seoKeywords + "_" + seoName + "_" + seoSuffix, tagPriority: 10 }
  152. ]
  153. });
  154. //4.设置seo信息 end---------------------------------------->
  155. onMounted(async () => {
  156. //从客户端获取行政职能部门 加快打开速度
  157. const { $webUrl, $CwebUrl } = useNuxtApp();
  158. //广告1
  159. let url = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=snzxw_page_0001`
  160. const responseAd1 = await fetch(url, {
  161. headers: {
  162. 'Content-Type': 'application/json',
  163. 'Userurl': $CwebUrl,
  164. 'Origin': $CwebUrl
  165. }
  166. });
  167. const resultAd1 = await responseAd1.json();
  168. adImg1.value = resultAd1.data[0];
  169. //广告2
  170. let url2 = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=snzxw_page_0002`
  171. const responseAd2 = await fetch(url2, {
  172. headers: {
  173. 'Content-Type': 'application/json',
  174. 'Userurl': $CwebUrl,
  175. 'Origin': $CwebUrl
  176. }
  177. });
  178. const resultAd2 = await responseAd2.json();
  179. adImg2.value = resultAd2.data[0];
  180. })
  181. </script>
  182. <style lang="less" scoped>
  183. @media screen and (min-width: 1401px) {
  184. //导航条
  185. .breadcrumb {
  186. width: 100%;
  187. .inner {
  188. width: 1200PX;
  189. margin: 10PX auto;
  190. border-bottom: 1PX solid #E5E5E5;
  191. }
  192. .el-breadcrumb::v-deep {
  193. display: inline-block;
  194. vertical-align: -4PX;
  195. }
  196. .el-breadcrumb__inner a::v-deep,
  197. .el-breadcrumb__inner.is-link::v-deep {
  198. color: #666666;
  199. font-weight: 400;
  200. text-decoration: none;
  201. transition: var(--el-transition-color);
  202. }
  203. span {
  204. font-family: "宋体";
  205. font-weight: 400;
  206. font-size: 14PX;
  207. color: #666666;
  208. line-height: 40PX;
  209. text-align: left;
  210. font-style: normal;
  211. text-transform: none;
  212. }
  213. .location {
  214. margin-right: 10PX;
  215. display: inline-block;
  216. height: 40PX;
  217. line-height: 40PX;
  218. font-family: "宋体";
  219. font-weight: 400;
  220. font-size: 14PX;
  221. color: #666666;
  222. vertical-align: 11PX;
  223. }
  224. }
  225. // 资讯列表
  226. .newsDetail {
  227. width: 100%;
  228. margin-bottom: 70PX;
  229. .inner {
  230. width: 1200PX;
  231. font-size: 16PX;
  232. margin: 0 auto;
  233. .innerLeft {
  234. width: 980PX;
  235. float: right;
  236. margin-right:0px;
  237. .LeftTop {
  238. margin-top: 50PX;
  239. >h1 {
  240. line-height: 40PX;
  241. margin-bottom: 30PX;
  242. font-family: Microsoft YaHei, Microsoft YaHei;
  243. font-weight: bold;
  244. font-size: 30PX;
  245. color: #333333;
  246. }
  247. >p {
  248. height: 18PX;
  249. line-height: 18PX;
  250. font-family: Microsoft YaHei, Microsoft YaHei;
  251. font-weight: 400;
  252. font-size: 14PX;
  253. color: #999999;
  254. span {
  255. margin-right: 40PX;
  256. }
  257. }
  258. >img {
  259. width: 680PX;
  260. height: 382PX;
  261. padding: 50PX 0PX 60PX 55PX;
  262. }
  263. }
  264. .leftBottomImg {
  265. width: 760PX;
  266. height: 184PX;
  267. margin: 0 auto;
  268. }
  269. .leftBottom {
  270. width: 92%;
  271. font-size: 20PX;
  272. padding-top: 40PX;
  273. margin: 0 auto;
  274. font-family: "微软雅黑", Microsoft YaHei;
  275. line-height: 36PX;
  276. >h3,
  277. >p {
  278. text-indent: 2em;
  279. width: 790PX;
  280. font-family: "微软雅黑", Microsoft YaHei;
  281. font-size: 20PX;
  282. color: #333333;
  283. line-height: 23PX;
  284. padding-bottom: 30PX;
  285. }
  286. >h3 {
  287. font-weight: 600PX;
  288. }
  289. >p {
  290. font-weight: 400;
  291. }
  292. }
  293. }
  294. .innerRight {
  295. width: 200PX;
  296. margin-top: 20PX;
  297. margin-left:0px;
  298. font-family: "微软雅黑";
  299. ul {
  300. li {
  301. a {
  302. display: block;
  303. height: 50PX;
  304. line-height: 50PX;
  305. color: #000;
  306. background: #f3f3f3;
  307. font-size: 18PX;
  308. text-decoration: none;
  309. padding-left: 35PX;
  310. box-sizing: border-box;
  311. border-bottom: 1PX solid #fff;
  312. }
  313. }
  314. }
  315. .active {
  316. border-left: 0;
  317. background: #3395e4;
  318. color: #fff;
  319. }
  320. }
  321. }
  322. }
  323. }
  324. @media screen and (min-width: 801px) and (max-width: 1400px) {
  325. //导航条
  326. .breadcrumb {
  327. width: 100%;
  328. .inner {
  329. width: 90%;
  330. margin: 10PX auto;
  331. border-bottom: 1PX solid #E5E5E5;
  332. }
  333. .el-breadcrumb::v-deep {
  334. display: inline-block;
  335. vertical-align: -4PX;
  336. }
  337. .el-breadcrumb__inner a::v-deep,
  338. .el-breadcrumb__inner.is-link::v-deep {
  339. color: #666666;
  340. font-weight: 400;
  341. text-decoration: none;
  342. transition: var(--el-transition-color);
  343. }
  344. span {
  345. font-family: "宋体";
  346. font-weight: 400;
  347. font-size: 14PX;
  348. color: #666666;
  349. line-height: 40PX;
  350. text-align: left;
  351. font-style: normal;
  352. text-transform: none;
  353. }
  354. .location {
  355. margin-right: 10PX;
  356. display: inline-block;
  357. height: 40PX;
  358. line-height: 40PX;
  359. font-family: "宋体";
  360. font-weight: 400;
  361. font-size: 14PX;
  362. color: #666666;
  363. vertical-align: 11PX;
  364. }
  365. }
  366. // 资讯列表
  367. .newsDetail {
  368. width: 100%;
  369. margin-bottom: 70PX;
  370. .inner {
  371. width: 90%;
  372. margin: 0 auto;
  373. font-size: 16PX;
  374. .innerLeft {
  375. width: 75%;
  376. float: right;
  377. margin-right:0px;
  378. .LeftTop {
  379. margin-top: 50PX;
  380. >h1 {
  381. line-height: 40PX;
  382. margin-bottom: 30PX;
  383. font-family: Microsoft YaHei, Microsoft YaHei;
  384. font-weight: bold;
  385. font-size: 30PX;
  386. color: #333333;
  387. }
  388. >p {
  389. height: 18PX;
  390. line-height: 18PX;
  391. font-family: Microsoft YaHei, Microsoft YaHei;
  392. font-weight: 400;
  393. font-size: 14PX;
  394. color: #999999;
  395. span {
  396. margin-right: 40PX;
  397. }
  398. }
  399. >img {
  400. width: 680PX;
  401. height: 382PX;
  402. padding: 50PX 0PX 60PX 55PX;
  403. }
  404. }
  405. .leftBottomImg {
  406. width: 100%;
  407. img {
  408. width: 100%;
  409. }
  410. }
  411. .leftBottom {
  412. width: 92%;
  413. font-size: 20PX;
  414. padding-top: 40PX;
  415. margin: 0 auto;
  416. font-family: "微软雅黑", Microsoft YaHei;
  417. line-height: 36PX;
  418. >h3,
  419. >p {
  420. text-indent: 2em;
  421. width: 100%;
  422. font-family: "微软雅黑", Microsoft YaHei;
  423. font-size: 20PX;
  424. color: #333333;
  425. line-height: 23PX;
  426. padding-bottom: 30PX;
  427. }
  428. >h3 {
  429. font-weight: 600;
  430. }
  431. >p {
  432. font-weight: 400;
  433. }
  434. }
  435. }
  436. .innerRight {
  437. width: 20%;
  438. margin-top: 20PX;
  439. margin-right: 20PX;
  440. font-family: "微软雅黑";
  441. ul {
  442. li {
  443. a {
  444. display: block;
  445. height: 50PX;
  446. line-height: 50PX;
  447. color: #000;
  448. background: #f3f3f3;
  449. font-size: 18PX;
  450. text-decoration: none;
  451. padding-left: 35PX;
  452. box-sizing: border-box;
  453. border-bottom: 1PX solid #fff;
  454. }
  455. }
  456. }
  457. .active {
  458. border-left: 0;
  459. background: #3395e4;
  460. color: #fff;
  461. }
  462. }
  463. }
  464. }
  465. }
  466. @media screen and (max-width: 800px) {
  467. //导航条
  468. .breadcrumb {
  469. width: 100%;
  470. .inner {
  471. width: 100%;
  472. padding: 0 20px;
  473. border-bottom: 2px solid #E5E5E5;
  474. }
  475. .el-breadcrumb::v-deep {
  476. display: inline-block;
  477. vertical-align: -4px;
  478. }
  479. .el-breadcrumb__inner a::v-deep,
  480. .el-breadcrumb__inner.is-link::v-deep {
  481. color: #666666;
  482. font-weight: 400;
  483. text-decoration: none;
  484. transition: var(--el-transition-color);
  485. }
  486. span {
  487. font-family: "宋体";
  488. font-weight: 400;
  489. font-size: 28px;
  490. color: #666666;
  491. line-height: 80px;
  492. text-align: left;
  493. font-style: normal;
  494. text-transform: none;
  495. }
  496. .location {
  497. margin-right: 10px;
  498. display: inline-block;
  499. height: 80px;
  500. line-height: 80px;
  501. font-family: "宋体";
  502. font-weight: 400;
  503. font-size: 28px;
  504. color: #666666;
  505. vertical-align: 24px;
  506. }
  507. }
  508. // 资讯列表
  509. .newsDetail {
  510. width: 100%;
  511. margin-bottom: 70px;
  512. .inner {
  513. width: 100%;
  514. font-size: 32px;
  515. .innerLeft {
  516. width: 100%;
  517. margin-top: 20px;
  518. .leftBottomImg {
  519. width: 100%;
  520. text-align: center;
  521. img {
  522. width: 96%;
  523. }
  524. }
  525. .leftBottom {
  526. width: 92%;
  527. font-size: 40px !important;
  528. padding-top: 40px;
  529. margin: 0 auto;
  530. font-family: "微软雅黑", Microsoft YaHei;
  531. line-height: 72px;
  532. h3,
  533. p {
  534. width: 100%;
  535. font-family: "微软雅黑", Microsoft YaHei;
  536. font-size: 40px;
  537. color: #333333;
  538. line-height: 72px;
  539. padding-bottom: 30px;
  540. }
  541. h3 {
  542. font-weight: 600;
  543. }
  544. p {
  545. font-weight: 400;
  546. }
  547. span {
  548. font-size: 40px !important;
  549. }
  550. }
  551. }
  552. .innerRight {
  553. display: none;
  554. width: 200px;
  555. margin-top: 20px;
  556. font-family: "微软雅黑";
  557. ul {
  558. li {
  559. a {
  560. display: block;
  561. height: 50px;
  562. line-height: 50px;
  563. color: #000;
  564. background: #f3f3f3;
  565. font-size: 18px;
  566. text-decoration: none;
  567. padding-left: 35px;
  568. box-sizing: border-box;
  569. border-bottom: 1px solid #fff;
  570. }
  571. }
  572. }
  573. .active {
  574. border-left: 0;
  575. background: #3395e4;
  576. color: #fff;
  577. }
  578. }
  579. }
  580. }
  581. }
  582. </style>